export const serverUrl = "http://192.168.18.11:3006";

/**
 * 处理图片
 * @param img
 * @returns
 */
export const dalImg = (img: string) => {
  if (img) {
    if (img.startsWith("http")) return img;
    return serverUrl + img;
  }
  return "https://img0.baidu.com/it/u=2100621783,2324697156&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500";
};

export const setToken = (token: string) =>
  sessionStorage.setItem("token", token);

export const getToken = () => sessionStorage.getItem("token");

export const removeToken = () => sessionStorage.removeItem("token");
